package com.huaweicloud.persistent.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaweicloud.commons.pojo.User;
import com.huaweicloud.persistent.entity.BsUserScheme;
import com.huaweicloud.persistent.mapper.BsUserSchemeMapper;
import com.huaweicloud.persistent.mapper.UserMapper;
import org.springframework.stereotype.Service;

/**
 * user service接口
 */
@Service
public class BsUserSchmeRepository extends ServiceImpl<BsUserSchemeMapper, BsUserScheme> {

    public BsUserScheme findSchemeByUserId(String userId, String schemeName) {
        LambdaQueryWrapper<BsUserScheme> query = Wrappers.lambdaQuery();
        query.eq(BsUserScheme::getUserName, userId);
        query.eq(BsUserScheme::getSchemeName, schemeName);
        return this.getOne(query);
    }
}
